import request from '@/utils/request'

// 分切制令单列表
export const GetListAPI = params => {
  return request({
    url: '/production/cut-orders-document/list',
    method: 'GET',
    params
  })
}

// 新增
export const AddDataAPI = data => {
  return request({
    url: '/production/cut-orders-document/add',
    method: 'POST',
    data
  })
}

// 是否免检修改（1：开，2：关）
export const isSwitchAPI = data => {
  return request({
    url: '/production/cut-orders-document/switch',
    method: 'PUT',
    data
  })
}

// 查看
export const GetViewAPI = data => {
  return request({
    url: '/production/cut-orders-document/view/' + data,
    method: 'GET'
  })
}

// 上线
export const GoOnLineAPI = data => {
  return request({
    url: '/production/cut-orders-document/goOnline',
    method: 'POST',
    data
  })
}

// 分切完成
export const SlittingCompletionAPI = data => {
  return request({
    url: '/production/cut-orders-document/slittingCompletion',
    method: 'POST',
    data
  })
}

// 分卷
export const SubVolumeAPI = data => {
  return request({
    url: '/production/cut-orders-document/subVolume',
    method: 'POST',
    data
  })
}

// 停产
export const StopProductionAPI = data => {
  return request({
    url: '/production/cut-orders-document/stopProduction/' + data,
    method: 'GET'
  })
}

// 单据完成
export const CompletionDocumentsAPI = data => {
  return request({
    url: '/production/cut-orders-document/completionDocuments/' + data,
    method: 'GET'
  })
}

// 关结
export const CloseAPI = data => {
  return request({
    url: '/production/cut-orders-document/close',
    method: 'POST',
    data
  })
}

// 废料打印
export const WastePrintAPI = data => {
  return request({
    url: '/production/cut-orders-document/wastePrint',
    method: 'POST',
    data
  })
}
// 根据id获取线别
export const GetordersLinedocumentAPI = params => {
  return request({
    url: '/production/cut-orders-document-detail/view',
    method: 'GET',
    params
  })
}

// 根据车间id获取线别
export const GetModelingLineAPI = data => {
  return request({
    url: '/system/modeling/getModelingLine/' + data,
    method: 'GET'
  })
}

// 根据id获取线别
export const GetIDModelingLineAPI = params => {
  return request({
    url: '/production/cut-orders-document/getDataLineTypeName',
    method: 'GET',
    params
  })
}

// 分切制令单列表
export const GetDetailListAPI = params => {
  return request({
    url: '/production/cut-orders-document-detail/list',
    method: 'GET',
    params
  })
}

// 根据产品号码获取明细
export const GetDocumentDetailAPI = params => {
  return request({
    url: '/production/cut-orders-document-detail/view',
    method: 'GET',
    params
  })
}

// 销售发货列表查询
export const GetPickingSaleAPI = params => {
  return request({
    url: '/storage/pickingSale/list',
    method: 'GET',
    params
  })
}
